package com.spring.boot.springBoot.service;

import com.spring.boot.springBoot.entity.UserDemo;
import com.spring.boot.springBoot.jdbcTemple.UserDemoDao;
import com.spring.boot.springBoot.repository.UserResponsitory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Created by pactera on 2017/9/27.
 */
@Service
public class UserDemoService {

    @Autowired
    private UserResponsitory userResponsitory;

    @Autowired
    private UserDemoDao userDemoDao;

    public void save(UserDemo userDemo){
        userResponsitory.save(userDemo);
    }

    public UserDemo getById(long id){
        return userDemoDao.getById(id);
    }

}
